<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/admin/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }

        .tdrow {
            font-weight: bold;
        }
    </style>
</head>

<body>
    <div class="layui-form layuimini-form">
        <form action="" method="post" id="DataForm">
            <table class="layui-table">
                <tbody>
                    <tr>
                        <td colspan="6" style="font-weight: bold;font-size: 16px;">
                            基础信息
                        </td>
                    </tr>
                    <tr>
                        <td><span class="tdrow">订单号：</span>{$info.on}</td>
                        <td><span class="tdrow">创建时间：</span>{$info.addtime_text}</td>
                    </tr>
                    <tr>
                        <td><span class="tdrow">提货人名称：</span>{$info.user_name}</td>
                        <td><span class="tdrow">提货人手机号：</span>{$info.user_phone}</td>
                        <td><span class="tdrow">团长昵称：</span>{$info.bus_title}</td>
                        <td><span class="tdrow">提货地址：</span>{$info.bus_address}</td>
                    </tr>

                </tbody>
                <tbody>
                    <tr>
                        <td colspan="6" style="font-weight: bold;font-size: 16px;">
                            代理商信息
                        </td>
                    </tr>
                    <tr>
                        <td><span class="tdrow">昵称：</span>{$info.agent_title}</td>
                        <td><span class="tdrow">账号：</span>{$info.agent_account}</td>
                    </tr>

                </tbody>

                <tbody>
                    <tr>
                        <td colspan="6" style="font-weight: bold;font-size: 16px;">
                            商品信息
                        </td>
                    </tr>
                    <tr>
                        <td><span class="tdrow">商品名称</span></td>
                        <td><span class="tdrow">价格（单价）</span></td>
                        <td><span class="tdrow">数量：</span></td>
                        <td><span class="tdrow">合计（单价*数量）</span></td>
                    </tr>
                    {foreach $info['goods_info'] as $key => $vo}
                    <tr>
                        <td><span class="tdrow">{$vo.goods_title}-{$vo.goods_sku_title}</span</td>
                        <td><span class="tdrow">{$vo.d_money}</span></td>
                        <td><span class="tdrow">{$vo.num}</span></td>
                        <td><span class="tdrow">{$vo.z_money}</span></td>
                    </tr>
                    {/foreach}
                    <td><span class="tdrow">总价：{$info['money']}</span></td>
                </tbody>

                <!-- <tbody>

                    <tr>
                        <td colspan="6" style="font-weight: bold;font-size: 16px;">
                            发货操作
                        </td>
                    </tr>
                    <tr>
                        <td><span class="tdrow">订单状态：</span>
                            <select name="state" lay-filter="state">
                                <option value="1">已完成</option>
                                <option value="2">退款/退货</option>
                            </select>
                        </td>
                        <td id="admin_remarks" style="display: none;">
                            <textarea name="admin_remarks" placeholder="请输入内容" cols="30" rows="10"
                                class="layui-textarea"></textarea>
                        </td>

                    </tr>

                </tbody> -->
            </table>
            <!-- <div class="layui-form-item">
                <div class="layui-input-block" style="margin:auto;text-align: center;">
                    <input type="hidden" name="id" value="{$info.id}">
                    <button type="button" class="upButton layui-btn layui-btn-primary" id="closeButton"><i
                            class="fa fa-level-up"></i> 关闭</button>
                    <button id="saveButton" type="submit" class="layui-btn"><i class="fa fa-check"></i>
                        提交</button>
                </div>
            </div> -->
        </form>




    </div>
    <script src="/static/admin/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="/static/admin/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
    <script>
        var look_pic;
        layui.use(['layer', 'form', 'laydate', 'element', 'upload'], function () {
            var $ = layui.$, layer = layui.layer, table = layui.table, element = layui.element, laydate = layui.laydate, form = layui.form, upload = layui.upload;
            var indexFrame = parent.layer.getFrameIndex(window.name); //获取窗口索引
            form.on('select(state)', function (data) {
                if (data.value == 2) {
                    $("#admin_remarks").show();
                } else {
                    $("#admin_remarks").hide();
                }
            })
            $("#saveButton").on('click', function () {
                var loading = layer.open({ type: 3 });
                $.ajax({
                    url: "{:url('add')}",
                    type: 'post',
                    data: $("#DataForm").serialize(),
                    success: function (data) {
                        console.log(data);
                        layer.close(loading);
                        if (data.code == 0) {
                            parent.tableReload();
                            parent.layer.close(indexFrame);
                            parent.layer.msg(data.msg);
                        } else {
                            layer.msg(data.msg);
                        }
                    }
                })
                return false;
            })

            $("#closeButton").on('click', function () {
                parent.layer.close(indexFrame);
            })

            // 分步表单下一步
            $(".downButton").on('click', function () {
                var id = $(".layui-this").next().attr('lay-id');
                element.tabChange('itemTab', id);
            });
            // 分步表单上一步
            $(".upButton").on('click', function () {
                var id = $(".layui-this").prev().attr('lay-id');
                element.tabChange('itemTab', id);
            });

            look_pic = function (pic) {
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: ['auto'],
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: '<img src="' + pic + '" style="width:200px;" />'
                });
            };

        });
    </script>
</body>

</html>